#include "stdafx.h"
#include "detail/bmock_raw_len_checker.hpp"
#include "detail/bmock_message.hpp"

namespace bmock {
	raw_len_checker::raw_len_checker(const control_tools_ptr &tl)
		:tools_(tl)
		,loc_("",size_t(-1))
	{}

	void raw_len_checker::set_location(const location &loc) {
		loc_ = loc;
	}

	void raw_len_checker::check_pad_len(const std::string &name,const size_t exp,size_t act) const {
		tools_->require_equal(exp,act,message(IN_OUT_RAW_MEM_PAD_LEN,name),loc_);
	}

	bool raw_len_checker::check_not_pad_len(const std::string &,const size_t exp,size_t act) const{
		return tools_->warn_not_equal(exp,act,message(INVALID_IN_RAW_MEM),loc_);
	}

	void raw_len_checker::invalid_pad(const std::string &name) const {
		tools_->error(message(RAW_MEM_PAD,name),loc_);
	}
}